import java.util.Scanner;

/*
   买瓜子
 */
public class WorkTest120203 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入初始瓜子个数:");
        int num = sc.nextInt();
        int count = 0;
        while(true){
            if (num%2==0){
                num/=2;
            }else if(num%2==1&&num!=1){
                num=num*3+1;
            }else {
                break;
            }
         count++;
        }
        System.out.println("需要经过:"+count+"次变化,瓜子数量为1");
    }
}
